<?php
session_start();
error_reporting(0);
if($_SESSION['username']!="")
{
?>
<!DOCTYPE html>
<html lang="en">
   <head>
     <? include "./include/head.php"; ?>
	  <? include "./include/js.php"; ?>
	 <script type="text/javascript" src="jquery/jquery.min.js"></script>
		<script type="text/javascript" src="jquery/jquery.validate.min.js"></script>
		
		<script type="text/javascript">
		$(document).ready(function() {
			$('#produk').validate({
				rules: {
					berat: {
						digits: true,	
					}, 
					harga: {
						digits: true,
					}, 
					 
				},
				messages: {
					
					berat: {
						
						digits: "Harus di isi dengan Angka"
					},
					harga: {
						
						digits: "Harus di isi dengan Angka"
					},
					
				}
			});
		});
		
	
		</script>
  </head>
  <body>
  <? include "./include/body.php"; ?>
        <div class="span9">
        <div class="hero-unit">  
        <?php
	error_reporting(0);$input = $_GET["input"];
					if($input == "invalid")
					{
						echo"<b>Maaf data tidak lengkap, silahkan ulangi</b>" ;
					}				 
	?>
	 <form class="form-horizontal" action="product_process_add.php" method="post" enctype="multipart/form-data" id="produk">
            <fieldset>
             
                <div class="control-group">
                
                  <label class="control-label">Id Produk*</label>
                    <div class="controls">
                        <input type="text" name="id_produk" id="id_produk" class="required" >
                        <p class="help-block"></p>
                    </div>
                  <label class="control-label">Nama Produk*</label>
                    <div class="controls">
                        <input type="text"  name="nama_produk" id="nama_produk" size="30" class="required">
                        <p class="help-block"></p>
                    </div>
                  <label class="control-label">Komposisi</label>
                    <div class="controls">
                        <input name="komposisi" id="komposisi" type="text" size="30" >
                        <p class="help-block"></p>
                    </div>
                  
                   <label class="control-label">Kemasan</label>
                    <div class="controls">
                        <select name="kemasan"/>
						<!-- Daftar pilihan pada combobox -->
							<option value="pilih" selected >--Pilih Kemasan—</option>
							<option value="pak">Pak</option>
							<option value="kantong">Kantong</option>
                
						</select>
                        <p class="help-block"></p>
                    </div>
					<label class="control-label">Berat/gr*</label>
                    <div class="controls">
                        <input type="text" name="berat" id="berat" class="required" >
                        <p class="help-block"></p>
                    </div>
				<label class="control-label">Harga*</label>
                    <div class="controls">
                        <input name="harga" id="harga" type="text" size="30" class="required">
                        <p class="help-block"></p>
                    </div>
              
				<label class="control-label" for="input8" class="required">Foto*</label>
                    <div class="controls">
                        <input type="file" name="foto" size="40">         
                        <p class="help-block"></p>
						* Harus Diisi
                    </div>
					
                </div>
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                <button class="btn btn-danger" type="submit">
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Simpan&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                </button>
                &nbsp;&nbsp;&nbsp;
                <button class="btn btn-danger" type="reset" value="Reset">
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Batal&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                </button>
            </fieldset>
        </form>
            
            
          </div>
          </div><!--/row-->

         
            </div><!--/span-->
          </div><!--/row-->
        </div><!--/span-->
      </div><!--/row-->

      <hr>

 <? include "./include/menubawah.php"; ?>
    <?php
    
    ?>
  </body>
</html>
<?php
    }
else {
    include 'warning.php';
}
?>